/**
 * 
 */
package common.project.epic.db;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;

/**
 * @author vidalelu
 *
 */
public class EpicRuntimeProvider extends ContentProvider {
	
	
	
	public class EpicRTOpenHelper extends SQLiteOpenHelper {

		private static final String DB_NAME = "epicRunTimeDb";
		private static final int DB_VERSION = 1;
		
		public EpicRTOpenHelper(Context context) {
			super(context, DB_NAME, null, DB_VERSION);
			
		}

		@Override
		public void onCreate(SQLiteDatabase db) {
			
			//tabella in cui inserisco i dispositivi trovati durante la fase di inquiry
			String devicesRT = "CREATE TABLE devicesRT (mac INTEGER PRIMARY KEY NOT NULL  UNIQUE , name TEXT NOT NULL);";
			db.execSQL(devicesRT);
			
			//tabella dei MAC address in blacklist a cui non invio fino al tempo indicato in timestamp
			String devicesBL = "CREATE TABLE devicesRT (mac INTEGER PRIMARY KEY NOT NULL  UNIQUE , timestamp TEXT NOT NULL , description VARCHAR);";
			db.execSQL(devicesBL);
			
		}

		@Override
		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
			// TODO metodo da implementare ogni qualvolta viene rilasciata una versione nuova del software
			
			

		}
	
	}
	

	/**
	 * 
	 */
	public EpicRuntimeProvider() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#delete(android.net.Uri, java.lang.String, java.lang.String[])
	 */
	@Override
	public int delete(Uri uri, String selection, String[] selectionArgs) {
		// TODO Auto-generated method stub
		return 0;
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#getType(android.net.Uri)
	 */
	@Override
	public String getType(Uri uri) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#insert(android.net.Uri, android.content.ContentValues)
	 */
	@Override
	public Uri insert(Uri uri, ContentValues values) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#onCreate()
	 */
	@Override
	public boolean onCreate() {
		// TODO Auto-generated method stub
		return false;
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String)
	 */
	@Override
	public Cursor query(Uri uri, String[] projection, String selection,
			String[] selectionArgs, String sortOrder) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see android.content.ContentProvider#update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[])
	 */
	@Override
	public int update(Uri uri, ContentValues values, String selection,
			String[] selectionArgs) {
		// TODO Auto-generated method stub
		return 0;
	}

}
